package net.joint_painting.server.logic;

import net.joint_painting.server.manager.UpdatesManager;
import net.joint_painting.server.model.MemCache;

/**
 * @author CAM
 * @version $Revision: 1.0 $
 */
public class Surface {

    /**
     * Method drawSurface.
     * 
     * @param id
     *            String
     * @param data
     *            String
     */
    public static void drawSurface(String id, String data) {
	net.joint_painting.server.model.JointPaintingSurface surface = net.joint_painting.server.model.JointPaintingSurface
		.getSurface(id);
	if (surface == null) {
	    surface = new net.joint_painting.server.model.JointPaintingSurface(id);
	}
	surface.setData(data);
	surface.save();
	UpdatesManager.addSurface(id);
	MemCache.cache(id, data);
    }

}
